package com.situ.student.service.impl;

import java.util.ArrayList;
import java.util.List;

import com.situ.student.dao.IStudentDao;
import com.situ.student.dao.impl.StudentDaoJdbcImpl;
import com.situ.student.dao.impl.StudentDaoMemoryImpl;
import com.situ.student.entity.Student;
import com.situ.student.service.IStudentService;

public class StudentServiceImpl implements IStudentService{
	//private IStudentDao studentDao = new StudentDaoMemoryImpl();//调用内存
	private IStudentDao studentDao = new StudentDaoJdbcImpl();

	
	@Override
	public void insert(Student student) {
		
	}

	@Override
	public List<Student> list() {
		List<Student> list = studentDao.list();
		List<Student> copyList = new ArrayList<>();
		for (Student student : list) {
			student.setName("Java1807" + student.getName());
			copyList.add(student);
		}
		return copyList;
		//return studentDao.list();
	}

}
